<?php 
use yii\helpers\Url;
?>
<style>
/*    .table tbody tr td {white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}*/
#home .home-mid .rank .rank-main .table thead th{font-size: 16px;color: #878da1;}
#home .home-mid .rank .rank-main .table tbody tr:hover input{background-color: #fff0f4;}
#home .home-mid .rank .rank-main .table tbody tr.noMsg td{padding-top: 80px!important;}
#home .home-mid .rank .rank-main .table tbody tr.noMsg:hover td{background-color: #fff;}
#home .home-mid .rank .rank-main .table tbody tr.noMsg td .noMsg-data{font-size: 14px;color: #bbadaa;line-height: normal;}
body{ background: #f7f6fc;}
.todayRev-main{ background-color:#fff; }
.rank ul {background-color:#fff;}
.rank-main{background-color:#fff;}
.rank-main .table thead th{background-color:#fff !important;}
#home .home-mid .rank ul li.active{ background:#fe7b9d; }
#home .home-mid .rank ul li.active a{color: #fff;}
.home-bot .monthCon{ background: #fff !important;}
.table tbody tr:hover,.table tbody tr:hover{
    background: #fff!important;
    border: 0;
}
.table tbody tr:hover td:first-child:before{
    border: 0;
}
.table tr{cursor: auto;}

#home .home-mid .rank .rank-main .table tbody tr.noMsg:hover td{background: transparent}

@media (min-width: 992px) and (max-width: 1440px){
    #home .home-mid .rank .rank-main .table thead th{
        font-size: 14px;
    }
    #home .home-mid .todayRev {
        width: 65.88%;
    }
    #home .home-mid .rank{
        width: 32.94%;
    }

    #home .home-tips{
        display: -webkit-box;
        display: -moz-box;
        display: -ms-flexbox;
        display: -webkit-flex;
        display: flex;
    }
}
</style>
<div class="row borB" >
    <div class="container lh30">
        <a class="topNav" href=""><img src="<?= Yii::getAlias('@web/backend/img/home/home1.png') ?>" alt="首页"/>首页</a>
    </div>
</div>
<div id="home" class="container">
    <div class="row home-tips">
    <div class="content online">
        <a href="<?=Url::toRoute(['/openapi/shop/index']) ?>">
            <div class="round-bg border-color1">
                <div>
                  <img src="<?= Yii::getAlias('@web/backend/img/home/xianshangbg.png') ?>" alt=""/>
                  <img src="<?= Yii::getAlias('@web/backend/img/home/xianshangdianpu.png') ?>" alt=""/>
                </div>
            </div>
            <div class="name">线上店铺</div>
            <div class="content-sub">七天内共<span class="red"><?php echo $shop_num;?></span>人浏览</div>
        </a>
    </div>
    <div class="content cashier">
        <a href="<?=Url::toRoute(['/business/financial/cashier']) ?>">
             <div class="round-bg border-color2">
                <div>
                  <img src="<?= Yii::getAlias('@web/backend/img/home/shouyinbg.png') ?>" alt=""/>
                  <img src="<?= Yii::getAlias('@web/backend/img/home/shouyin.png') ?>" alt=""/>
                </div>
            </div>
            <div class="name">收银</div>
        </a>
    </div>
    <div class="content service">
        <a href="<?=Url::toRoute(['/business/server/register']) ?>">
           <div class="round-bg border-color3">
                <div>
                  <img src="<?= Yii::getAlias('@web/backend/img/home/fuwudengjibg.png') ?>" alt=""/>
                  <img src="<?= Yii::getAlias('@web/backend/img/home/fuwudengji.png') ?>" alt=""/>
                </div>
            </div>
            <div class="name">服务登记</div>
        </a>
    </div>
    <div class="content member">
        <a href="<?=Url::toRoute(['/business/member']) ?>">
            <div style="position: absolute;top: 30px;text-align: center;width: 100%;">今日过生<span class="red"><?= $birthday_count ?></span></div>
            <div class="round-bg border-color4">
                <div>
                  <img src="<?= Yii::getAlias('@web/backend/img/home/huiyuanbg.png') ?>" alt=""/>
                  <img src="<?= Yii::getAlias('@web/backend/img/home/huiyuan.png') ?>" alt=""/>
                </div>
            </div>
            <div class="name">会员</div>
            <div class="content-sub">今日到店：<em class="red"><?php echo $bus_services;?></em> 今日新增：<em class="red"><?php echo $bus_members[0]['count_member_id'];?></em></div>
        </a>
    </div>
    <div class="content business">
        <a href="<?=Url::toRoute(['/business/financial/cashier','action' => 'saleamount']) ?>">
           <div class="round-bg border-color5">
                <div>
                  <img src="<?= Yii::getAlias('@web/backend/img/home/yingyeliushuibg.png') ?>" alt=""/>
                  <img src="<?= Yii::getAlias('@web/backend/img/home/yingyeliushui.png') ?>" alt=""/>
                </div>
            </div>
            <div class="name">营业流水</div>
            <div class="content-sub">今日营收：<em class="red"><?php echo $consumeList[0]['consume_amount']?$consumeList[0]['consume_amount']:0;?></em>元 今日消耗：<em class="red"><?php echo $bus_service_extends[0]['consume_amount']?$bus_service_extends[0]['consume_amount']:0;?></em>元</div>
        </a>
    </div>
    <div class="content appointment">
        <a href="<?=Url::toRoute(['/business/server/make']) ?>">
           <div class="round-bg border-color6">
                <div>
                  <img src="<?= Yii::getAlias('@web/backend/img/home/yuyuetixingbg.png') ?>" alt=""/>
                  <img src="<?= Yii::getAlias('@web/backend/img/home/yuyuetixing.png') ?>" alt=""/>
                </div>
            </div>
            <div class="name">预约提醒</div>
            <em><?php echo $bus_service_order;?></em>
        </a>
    </div>
</div>
    <div class="home-mid  clearfix">
        <div class="todayRev pull-left">
            <div class="title"><span>今日营收</span></div>
            <div class="todayRev-main">
                <div id="con1" class="con1" "></div>
                <div id="con2" class="con2"></div>
            </div>
        </div>
        <div class="rank pull-right">
            <div class="title">
                <span>本月排行榜</span>
            </div>
            <ul class="clearfix">
                <li class="active"><a href="#tab1" data-toggle="tab">消费最高</a></li>
                <li><a href="#tab2" data-toggle="tab">热销单品</a></li>
                <li><a href="#tab3" data-toggle="tab">热销服务</a></li>
            </ul>
            <div class="rank-main tab-content">
                <div class="tab-pane active" id="tab1">
                    <table class="table table-striped">
                        <thead>
                        <tr>
                            <th>排名</th>
                            <th>姓名</th>
                            <th>消费金额</th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php
                          if (!empty($member_pay)) {
                                 foreach($member_pay as $k=>$v){
                        ?>
                        <tr>
                            <td><em></em></td>
                            <td><a href="<?php echo Url::to(['/business/member/basic', 'id' => $v['member_id']]);?>"><?php echo $v['member_name'];?></td>
                            <td>￥<?php echo $v['consume_amount'];?>元</td>
                        </tr>
                        <?php }} else{ ?>
                                <tr class="noMsg"  style="border-left: none;">
                                    <td colspan="3" align="center"><img src="<?= Yii::getAlias('@web/backend/img/home/index_listnone.gif') ?>" alt=""/><div class="noMsg-data">快去收银吧，<br>这样可以记录会员消费哟</div></td>
                                </tr>
                        <?php } ?>
                        </tbody>
                    </table>
                </div>
                <div class="tab-pane" id="tab2">
                    <table class="table table-striped">
                        <thead>
                        <tr>
                            <th style="width: 80px;">排名</th>
                            <th style="width: 120px;">产品名称</th>
                            <th style="width: 80px;">规格</th>
                            <th style="width: 80px;">库存</th>
                            <th style="width: 80px;">销量</th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php
                         if (!empty($goods_dec[0]['dec_count'])) {
                            foreach($goods_dec as $k=>$v){
                        ?>
                            <tr>

                                <td><em></em></td>
                                <td><input class="read-only" style="width: 80px" type="text" value="<?php echo $v['repertory_name']?>" readonly/></td>
                                <td><input class="read-only" style="width: 89px" type="text" value="<?php echo $v['repertory_specs']?>" readonly/></td>
                                <td><?php echo $v['repertory_count']?></td>
                                <td><?php echo $v['dec_count']?></td>
                            </tr>
                        <?php }} else{  ?>
                                <tr class="noMsg"><td colspan="5" align="center"><img src="<?= Yii::getAlias('@web/backend/img/home/index_listnone.gif') ?>" alt=""/><div class="noMsg-data">快去收银吧，<br>这样可以记录家居产品售卖数量哦</div></td></tr>
                        <?php } ?>
                        </tbody>
                    </table>
                </div>

                <div class="tab-pane" id="tab3">
                    <table class="table table-striped">
                        <thead>
                        <tr>
                            <th>排名</th>
                            <th>服务名称</th>
                            <th>次数</th>
                            <th>销量</th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php
                        if (!empty($bus_member_beautycard)) {
                            foreach($bus_member_beautycard as $k=>$v){?>
                        <tr>
                            <td><em></em></td>
                            <td><?php echo $v['config_key']?></td>
                            <td>
                                <?php if ($v['finance_type'] == 2) { echo $v['config_val']; }else { echo 1;} ?>次
                            </td>
                            <td><?php echo $v['dec_count']?></td>
                        </tr>
                        <?php }} else { ?>
                                   <tr class="noMsg"><td colspan="4" align="center"><img src="<?= Yii::getAlias('@web/backend/img/home/index_listnone.gif') ?>" alt=""/><div class="noMsg-data">快去收银吧，<br>这样可以记录卡项售卖数量哦</div></td><tr/>
                         <?php }?>
                        </tbody>
                    </table>
                </div>

            </div>
        </div>
    </div>
    <div class="home-bot">
        <div class="title mt20"><span>本月营收走势图</span></div>
        <div id="monthCon" class="monthCon" style=" border: 1px solid #dedede; margin: 20px 0; "></div>
    </div>
</div>
<?php $this->registerJsFile("@web/libs/echart/echarts.common.min.js",['position'=>$this::POS_END]);?>
<?php $this->registerJsFile("@web/system/site/index.js",['position'=>$this::POS_END]);?>